Charles daEngineer

Skywater 130nm Library Model Evaluation

Published on Tue Jul 05 2022

Introduction

Skywater's collaboration with Google is excellent. However there are some issues with there MOSFET models that need to be documented. I'd like to first show what works so this when we go to what doesn't we can observe why.

Testing Environment

All of the following tests can be done locally using ngspice but to avoid dependencies I'd like to first use tools available online. For simulation I will use the wasm ported version of ngspice which can be found at eesim.dev. The simulation and plotting at this website is excellent; however I will also require manipulating the output which requires some data analysis software. For the data analysis I will use the excellent site jupyter lab where I can use python in a jupyter notebook.

Simulation with eesim

I'm only testing one mosfet at a time the spice code for doing so is:

nfet1V8 I-V curve
.include modelcard.skywater
.param mc_switch=0
* Gate bias
X1 vdn vgn 0 vbn sky130_fd_pr__nfet_01v8 w=10u l=0.15u

* DC source for current measure
vdsn     vdn 0       dc 0.9  
vgsn     vgn 0       dc 0    
vbsn     vbn 0       dc 0  

* This is the analysis
.dc vgsn 0 1.8 0.01

.save @m.X1.msky130_fd_pr__nfet_01v8[id]
.save @m.X1.msky130_fd_pr__nfet_01v8[gm]
.end

For more information on the save command check out section 15.6.1 of the ngspice manual. Also, for my tests the line ".param mc_switch=0" was required, however in ngspice this isn't required.

The below image is what my setup looks like.

image of eesim.dev netlist

After running you can view the data plotted, you should be able to see both the gm and id data. Instead download the data by clicking the csv button:

image of eesim.dev csv button

After downloading we are ready analyze the data using jupyter lab.

Data Analysis using Jupyter Online

We need to open a new notebook, and upload our csv data that we downloaded

image of jupyter upload button

Now all we have to do is parse the csv file, divide gm and id then plot. This can be done with the following code:

import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('EEsim (2).csv')
gmID=df['@m.x1.msky130_fd_pr__nfet_01v8[gm] ']/df['i(@m.x1.msky130_fd_pr__nfet_01v8[id]) ']
plt.plot(df['v(v-sweep) '], gmID)
plt.show() | highlightsyntax("python")

The first sign that everything is probably okay is the function is monotonic as VGS increases, this means the current is increasing as VGS is increased.

Testing with the PMOS

Testing PMOS in eesim.dev requires the code below:


pfet1V8_hvt I-V curve
.include modelcard.skywater

.param mc_switch=0

* Gate bias
X1 vdp vgp 0 vbp sky130_fd_pr__pfet_01v8_hvt w=2u l=0.15u

* DC source for current measure
vdsp     0  vdp        dc 0.9  
vgsp     0  vgp        dc 0    
vbsp     0  vbp        dc 0  

* This is the analysis
.dc vgsp 0 1.8 0.01

.save @m.X1.msky130_fd_pr__pfet_01v8_hvt[id]
.save @m.X1.msky130_fd_pr__pfet_01v8_hvt[gm]
.end

After downloading the csv file we can plot gm/ID with python like we did above with the following code:

import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('EEsim (3).csv')
gmID=df['@m.x1.msky130_fd_pr__pfet_01v8_hvt[gm] ']/df['i(@m.x1.msky130_fd_pr__pfet_01v8_hfet[id]) ']
plt.plot(df['v(v-sweep) '], gmID)
plt.show() | highlightsyntax("python")

This hill near VGS=730mV is a a sign that the models or the devices are not working correctly around VGS=730mV.